<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<link type="text/css" rel="stylesheet" href="{TPL}css/AddItemPanel.css">
<link type="text/css" rel="stylesheet" href="{TPL}css/NewTopFoot.css"  />
<link type="text/css" id="styleName" rel="stylesheet" href="{TPL}css/blue/color.css"/ >    
<link type="text/css" rel="stylesheet" href="{TPL}css/orderList.css"/>
<script src="{TPL}js/jquery-1.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript" src="{TPL}js/wdggcGobal.js"></script>
 <script src="{TPL}js/Gobal.js" type="text/javascript"></script>
    <script type="text/javascript">
        function cancel(id) {
            if (!confirm("{lang m_ship_remove_q}")) { return; }
            $.ajax({
                type: "POST",
                url: "/m.php?name=sendorderlist&action=cancel",
                dataType: "json",
                contentType: "application/json;utf-8",
                data: "{'id':'" + id + "'}",
                timeout: 10000,
                error: function() { alert('{lang u_internet_fild}'); },
                success: function(r) {
                    switch (r) {
                        case "OK": alert("{lang m_ship_remove_succed}"); $("#sendordertable_" + id).remove(); if ($(".o_wu table").length <= 1) { window.location = window.location.href } break;
                        default: alert(r);
                    }
                }
            });
        }
        function pay(id) {
            if (!confirm("{lang m_ship_send_q}")) { return; }
            $.ajax({
                type: "POST",
                url: "/m.php?name=sendorderlist&action=pay",
                dataType: "json",
                contentType: "application/json;utf-8",
                data: "{'id':'" + id + "'}",
                timeout: 10000,
                error: function() { alert('{lang u_internet_fild}'); },
                success: function(r) {
                    switch (r) {
                        case "OK": alert("{lang m_pay_succed}");  window.location = window.location.href;return;
                        default: alert(r);
                    }
                }
            });
        }
        function receive(id, dom) {
            if (!confirm("{lang m_recieve_package_q}")) { return; }
            $(dom).attr("disabled", "disabled");
            $.ajax({
                type: "POST",
                url: "/m.php?name=sendorderlist&action=receive",
                dataType: "json",
                contentType: "application/json;utf-8",
                data: "{'id':'" + id + "'}",
                timeout: 10000,
                error: function() { alert('{lang u_internet_fild}'); $(dom).removeAttr("disabled"); },
                success: function(r) { $(dom).removeAttr("disabled"); if (r == "OK") { alert("{lang m_recieve_ok}");  window.location = window.location.href} }
            });
        }
		function done_receive(id) {
            if (!confirm("{lang m_space_draw_q}")) { return; }
            $.ajax({
                type: "POST",
                url: "/m.php?name=sendorderlist&action=done_receive",
                dataType: "json",
                contentType: "application/json;utf-8",
                data: "{'id':'" + id + "'}",
                timeout: 10000,
                error: function() { alert('{lang u_internet_fild}'); },
                success: function(r) {
                    switch (r) {
                        case "OK": alert("{lang m_space_succed}");  window.location.reload();return;
                        default: alert(r);
                    }
                }
            });
        }
 var remarkPanel = "<div class=\"beizhu\"><div style=\"width: 270px; overflow: hidden; float: left;\"><div class=\"if\"><label id=\"noremarkLb\"><input id=\"noremark\" type=\"checkbox\" />{lang m_no_ckeck}</label></div><textarea id=\"remarkContent\" cols=\"\" rows=\"\"></textarea><dl><dt><input id=\"remarkSubmit\" type=\"button\" value=\"{lang s_post}\" /></dt><dd><input id=\"remarkClose\" type=\"button\" onclick=\"closeRemarkPanel();\" value=\"{lang s_close}\" /></dd></dl></div><img src=\"/images/jiantou.gif\" /></div>";
 function showRemarkPanel(id, type, dom) {
    $(".beizhu").remove(); $(dom).before(remarkPanel); $("#remarkContent").val($("#remark" + id).val()); if (type) { $("#noremark").click(function() { if (this.checked) { $("#remarkContent").attr("disabled", "disabled").val("{lang m_service_satis}"); } else { $("#remarkContent").removeAttr("disabled").val($("#remark" + id).val()); } }); $("#remarkSubmit").click(function() { upRemark(id, $.trim($("#remarkContent").val())); }); } else { $("#remarkContent").attr("disabled", "disabled").css({ background: "#eeeeee", color: "#bbbbbb", border: "#bbbbbb solid 1px" }); $("#noremarkLb").css({ color: "#bbbbbb" }); $("#noremarkLb input").attr("disabled", "disabled"); $("#remarkSubmit").remove(); }
    $(".beizhu").animate({ width: "282px", marginLeft: "-244px" }, 300, function() { });
}
function closeRemarkPanel() { if ($(".beizhu").length > 0) { $(".beizhu").animate({ width: "0", marginLeft: "-2px" }, 300, function() { $(this).remove(); }); } }
 function upRemark(id, content) {
    $.ajax({ type: "POST",
        url: "/m.php?name=sendorderlist&action=upcomment",
        dataType: "json",
        contentType: "application/json;utf-8",
        data: "{'comment':'" + content + "','sid':" + id + "}",
        timeout: 6000,
        error: function() {
            alert("{lang m_ev_fail}");
        },
        success: function(resault) {
            if (resault == 'OK') {
                closeRemarkPanel();
                $("#remark" + id).val(content);
                alert("{lang m_ev_succed}");
            }
            else{
                alert(resault);
            }
        }
    });
}
        $(function() {
            if (typeof document.body.style.maxHeight == "undefined") {
                $("#success").css("position", "absolute").css("margin-top", "0px");
                var divY = (getViewportHeight() - $("#ProVotePanel").outerHeight()) / 2;
                $("#success").css("top", (divY + document.documentElement.scrollTop).toString());
                $(window).scroll(function() { $("#success").css("top", divY + document.documentElement.scrollTop + ""); });
            }
        });
    </script>
<title>{lang m_my_waybill}-{lang g_webname}</title>
</head>
<body>
{template 'header'}
<div class="admin">
        <div class="ding">
            <div class="shouye">
                <a title="{lang u_member_center}" href="{url_m.php}"></a>
            </div>
            <div class="lb">
                <div class="weizhi">
                      <b>{lang m_location}：</b><a href="{url_m.php}">{lang u_member_center}</a><span>&gt;</span>{lang u_want_shopping}
                  </div>
                <div class="shezhi">
                    <p>
                        <a href="{url_m.php}">{lang u_member_center}</a><span>|</span>{lang m_set_style}:</p>
                    <ul>
                        <li onclick="changeStyle('orange')" class="mypanliS1"></li>
                        <li onclick="changeStyle('grey')" class="mypanliS2"></li>
                        <li onclick="changeStyle('blue')" class="mypanliS3"></li>
                    </ul>
                </div>
            </div>
        </div>
{template 'member_left'}
    <div class="fill">
        <div class="circuit">
            <img alt="{lang m_step}" src="{TPL}images/donghua.gif">
        </div>
        <div class="o_wu" style="margin-top:20px">
	{if !empty($dataarray)}
		{loop $dataarray $r}
          <table border="0" cellpadding="0" cellspacing="0" id="sendordertable_{$r['sid']}" style="margin-top:10px">
            <tr class="bg hg">
                <td align="center" class="bk">{lang m_ship_no}</td>
              <td align="center" class="bk">{lang s_post_time}</td>
              <td align="center" class="bk">{lang m_reciever}</td>
              <td align="center" class="bk">{lang m_ship_method}</td>
              <td align="center" class="bk">{lang m_package_no}<img src="{TPL}images/wen.gif" width="16" height="16" hspace="2" align="baseline" /></td>
              <td align="center" class="bk">{lang m_ev_state}</td>
              <td align="center" class="bk">{lang s_weight}<br/><p style="color:blue">{lang s_fore_weight}</p></td>
              <td align="center" class="bk">{lang s_total}{lang s_price_ext}</td>
              <td align="center" class="bk">{lang s_notice}</td>
			  <td align="center" class="bk">{lang m_query_more}</td>
              <td align="center" class="bk">{lang m_action}</td>
            </tr>
            <tr class="bk hg">
                <td width="40" align="center" class="bk_top lan_font"><a title="{lang m_click_view_wayfill}" href="{url_m.php?name=orderlist&action=sendorder&sid=$r['sid']}" target="_blank">{$r['sid']}</a></td>
                <td width="80" align="center" class="bk_top">{date('Y-m-d H:i:s',$r['addtime'])}</td>
              <td width="80" align="center" class="bk_top">{$r['consignee']}</td>
              <td width="60" align="center" class="bk_top">{$r['deliveryname']}</td>
              <td width="85" align="center" class="bk_top"><a title="{lang m_click_view_wayfill}" href="{url_m.php?name=orderlist&action=sendorder&sid=$r['sid']}" style="font-size:13px" target="_blank"><?php if(!empty($r['sn'])){ echo str_replace(',',' ',$r['sn']); }else{ echo $r['yunshu_sn']; } ?>&nbsp;</a></td>
			 <?php $stateyunshu = array(10=>"往MAL运输中",11=>"已到MAL货舱") ?>
				  {if $r['state']==1}
				  <td width="60" align="center" class="bk_top"><?php $valuestate = $r['statename']; foreach($stateyunshu as $field=>$val){ if($field== $r['yunshu_state']){ $valuestate =$val; }}  echo $valuestate; ?></td>
				  {elseif $r['state']==7}
				  <td width="60" align="center" class="bk_top">{$r['statename']} <b>{$r['areaname']}-{$r['deliveryname']}</b></td>
				  {else}
				  <td width="60" align="center" class="bk_top">{$r['statename']}</td>
				  {/if}
              <td width="50" align="center" class="bk_top">{$r['countweight']}<br/><p style="color:blue">{$r['ext_weight']}</p></td>
              <td width="50" align="center" class="bk_top">{$r['totalfee']}</td>
			  <td width="80" align="center" class="bk_top">{$r['remark']}</td>
              <td width="35" align="center" class="bk_top"><a title="{lang m_query_more}" href="{url_m.php?name=sendordermoreinfo&action=sendorder&sid=$r['sid']}" style="font-size:13px" target="_blank"><img src="{TPL}images/yifa.gif" width="20px" height="20px"/></a></td>
              <td align="center" class="bk_top">
			  <input id="remark{$r['sid']}" type="hidden" value="{$r['reply']}"/>
			  {if $r['state']==1}
			  <!--<span class="cx"><a href="javascript:;" onclick="cancel({$r['sid']})">{lang Revocation_this_single}</a></span>-->
			  {elseif $r['state']==4}
					<span class="cx" style="color:red">{lang m_state_canceal}</span>
			  {elseif $r['state']==6}
                          <span class="cx"><a href="javascript:;" onclick="pay({$r['sid']})">{lang m_pay}</a></span>
			  {elseif $r['state']==7}
                          <span class="cx"><a href="cangwei.php?cat={$r['deliveryname']}&area={$r['areaname']}">{lang m_space_buy}</a></span>
						  <div style="clear:both"></div>
						  <span class="cx"><a href="javascript:;" onclick="done_receive({$r['sid']})">{lang m_space_draw}</a></span>
			  {elseif $r['state']==8}
                          <span class="cx">{lang m_state_wait_ship}</span>
			  {elseif $r['state']==3}
				{if empty($r['commenttime'])}
				<span class="cx"><a href="javascript:;" onclick="showRemarkPanel({$r['sid']}, 1, this)">{lang m_ship_evalut}</a></span>
				{else}
				{if !empty($r['reply'])}
				<span class="cx"><a href="javascript:;" onclick="showRemarkPanel({$r['sid']}, 0, this)">{lang m_reply_view}</a></span>
				{else}
				{lang m_ship_ev_state}
				{/if}
				{/if}
			  {else}
			  <span class="cx"><a href="javascript:;" onclick="receive({$r['sid']})">{lang m_state_ship_arrived}</a></span>
			  {/if}
			  </td>
            </tr>
            </table>
		{/loop}	
	{else}
<H2>{lang m_ship_not_post}……</H2>
<P><A href="{url_m.php?name=orderlist}">{lang m_my_shipping}</A><SPAN>|</SPAN><A href="{url_m.php?name=fillorders}">{lang u_want_shopping}</A><SPAN>|</SPAN><A href="{url_see.php}/See/">{lang u_look_around}</A></P> 
	{/if}
      </div>
    </div>
        <div class="yj">
        </div>
    </div>
{template 'footer'}
</body>
</html>